<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>020-操作位置.html</title>
	<style>
		*{
			margin: 0;
			padding: 0;
		}
		.father{
			width: 300px;
			height: 300px;
			border: 1px solid #000;
			margin: 100px auto;
			position: relative;
		}
		.son{
			width: 100px;
			height: 100px;
			background-color: red;
			position: absolute;
			top: 100px;
			left: 100px;
		}
	</style>
</head>
<body>
	<div class="father">
		<div class="son"></div>
	</div>
</body>
<script src="js/jquery-1.12.4.js"></script>
<script>
	$(function(){/*
		console.log($('.son').offset().top);
		console.log($('.son').offset({
			top:150,
			left:150
		}));
		*/
		console.log($('.son').position());
		//不能设置
		console.log($('.son').position({
			top:150,
			left:150
		}));
	})
</script>
</html>